package org.carl.base.dingtalk.bot.model.feedcard;

import cn.hutool.json.JSONUtil;
import org.carl.base.dingtalk.bot.enums.MsgTypeEnum;
import org.carl.base.dingtalk.bot.model.MsgModel;

import java.util.List;

/**
 * {
 *     "feedCard": {
 *         "links": [
 *             {
 *                 "title": "时代的火车向前开",
 *                 "messageURL": "https://www.dingtalk.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
 *                 "picURL": "https://gw.alicdn.com/tfs/TB1ayl9mpYqK1RjSZLeXXbXppXa-170-62.png"
 *             },
 *             {
 *                 "title": "时代的火车向前开2",
 *                 "messageURL": "https://www.dingtalk.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
 *                 "picURL": "https://gw.alicdn.com/tfs/TB1ayl9mpYqK1RjSZLeXXbXppXa-170-62.png"
 *             }
 *         ]
 *     },
 *     "msgtype": "feedCard"
 * }
 *
 * @author Carl
 */
public class FeedCardModel extends MsgModel {
    private FeedCardModel() {
        this.msgtype = MsgTypeEnum.feedCard;
    }

    private List<FeedCardLinksModel> feedCard;

    public static FeedCardModel feedCard(List<FeedCardLinksModel> feedCard) {
        FeedCardModel feedCardModel = new FeedCardModel();
        feedCardModel.feedCard = feedCard;
        return feedCardModel;
    }
    @Override
    public String toString() {
        return JSONUtil.toJsonStr(this);
    }
}
